Skip to content

bug: Add missing text field in Administered Medications #122

Open
vochaparro2 wants to merge 5 commits intomainfrom
laura-victor/1345-dosage-text
Open

bug: Add missing text field in Administered Medications #122
vochaparro2 wants to merge 5 commits intomainfrom
laura-victor/1345-dosage-text

Conversation

@vochaparro2
Copy link
Copy Markdown
Collaborator

Summary

The Medication Administrations mappings were missing a mapping for the text property. The property is now being mapped under MedicationAdministration.dosage.text

PR for viewer changes

Related Issue

Fixes #1345

Acceptance Criteria

  • FHIR conversion: Convert these fields to their appropriate FHIR resources.
  • Confirm whether these fields should be displayed in the Viewer (talk to Chinelo about this)
  • Add any relevant FHIR converter / Viewer tests needed

Additional Information

Anything else the review team should know?

Checklist

  • ⚠️ Create an associated dibbs-ecr-viewer PR & checked that things work on the front-end.
  • If necessary, update any test fixtures/bundles to reflect FHIR conversion changes (in this repo and/or dibbs-ecr-viewer)
  • If this code affects the other scrum team, have they been notified? (In Slack, as reviewers, etc.)

⚠️ Do not merge this PR until the associated dibbs-ecr-viewer PR is created and validated. When both have been approved:

  1. Merge the FHIR converter PR
  2. Cut a new release of dibbs-fhir-converter
  3. Update the fhir-converter Dockerfile in dibbs-ecr-viewer with the updated release branch number.

laura-puerto-skylight and others added 4 commits March 24, 2026 12:46
@vochaparro2 vochaparro2 requested a review from a team as a code owner March 31, 2026 15:50
@vochaparro2 vochaparro2 requested review from angelathe and laura-puerto-skylight and removed request for a team March 31, 2026 15:50
@laura-puerto-skylight
Copy link
Copy Markdown
Collaborator

Looks good to me! Since I helped with the changes I will let @angelathe approve :)

Comment on lines +27 to +31
{% if medicationAdministration.text._innerText %}
"text": "{{ medicationAdministration.text._innerText | clean_string_from_tabs | escape_special_chars }}",
{% else %}
"text": "{{ medicationAdministration.text._ | clean_string_from_tabs | escape_special_chars }}",
{% endif %}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perchance does the following work? (to reduce clutter)

"text": "{{ medicationAdministration.text._innertext | default: medicationAdministration.text._ | clean_string_from_tabs | escape_special_chars }}"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This had to be updated a lot to support the text reference.

"start": "1981-10-16T17:31:14Z"
},
"dosage": {
"text": "<reference value=\"#sig7\" xmlns=\"urn:hl7-org:v3\" />",
Copy link
Copy Markdown
Collaborator

@angelathe angelathe Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I tink this should actually have the #sig7 value. In MedicationAdministration resource, we should also add the case where text has a reference value that we can pull.

medicationAdministration.text.reference._ I think?

  • unit test

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good that we had a test message formatted this way. It took me a while to figure out how to extract that text. Let me know if there's a better way to handle that, but it makes it hard because the referenced text is at a higher level than the dosage text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants